package com.cn.readingcloud.homepage.common.config;


import com.cn.readingcloud.account.feign.client.LikeSeeClient;
import com.netflix.hystrix.*;
import feign.Feign;
import feign.hystrix.HystrixFeign;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 账户中心 - 喜欢看服务熔断配置
 **/
//@Configuration
//public class HystrixCommandLikeSeeConfig {
//
//    @Bean
//    public Feign.Builder likeSeeFeignHystrixBuilder() {
//        return HystrixFeign.builder().setterFactory((target, method) -> HystrixCommand.Setter
//                // 组
//                .withGroupKey(HystrixCommandGroupKey.Factory.asKey(LikeSeeClient.class.getSimpleName()))
//                .andCommandKey(HystrixCommandKey.Factory.asKey(LikeSeeClient.class.getSimpleName()))
//                .andCommandPropertiesDefaults(
//                        // 超时配置
//                        HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(500)
//                )
//                .andThreadPoolPropertiesDefaults(HystrixThreadPoolProperties.Setter()
//                        .withAllowMaximumSizeToDivergeFromCoreSize(true)
//                        .withMaximumSize(3)
//                        .withCoreSize(2)
//                        .withMaxQueueSize(20)
//                ));
//    }
//}
